package main.common.exception;

import main.common.utils.ResponseEnum;

/**异常类的包装方法
 * @author ChengGM
 * @create 2017-01-14 13:54
 **/
public class ServiceException extends Exception {
	private int code;
	private String businessMessage;

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getBusinessMessage() {
		return businessMessage;
	}

	public void setBusinessMessage(String businessMessage) {
		this.businessMessage = businessMessage;
	}

	public ServiceException() {
		super();
	}

	public ServiceException(Throwable e) {
		super(e);
	}

	public ServiceException(int code, String businessMessage) {
		this.code = code;
		this.businessMessage = businessMessage;
	}

	public ServiceException(ResponseEnum responseEnum, String message) {
		this.code = responseEnum.getCode();
		this.businessMessage = message;
	}

}
